package interfaces.loading;

import org.fenggui.decorator.background.PlainBackground;
import org.fenggui.util.Color;

import fileHandling.language.interfaces.OptionsWindowText;
import gameStates.absGamesStates.gui.AbsLoadingState;
import interfaces.GUISource;
import interfaces.PropertyContent;
import interfaces.language.LanguageLabel;
import interfaces.superWidgets.StaticContent;

public class GraphicChangeScreen extends LoadingScreen {
	
	
	
	public GraphicChangeScreen(AbsLoadingState loadingState) {
		super(loadingState);
		
		createLoadingBar();
	}
	
	private void createLoadingBar() {
		int width = getWidth() / 4 * 3;
		int contX = (getWidth() - width) / 2;
		int height = getHeight() / 30;
		
		loadingContent = new PropertyContent(width, height, contX, height / 2);
		loadingContent.setMaxValue(100f);
		loadingContent.setValue(0f);
		loadingContent.changeBackgroundColor(Color.BLUE);
		loadingContent.changeValueColor(Color.BLACK);
		addWidget(loadingContent);
		
		int labelX = loadingContent.getX();
		int labelY = loadingContent.getY() + loadingContent.getHeight();
		int labelWidth = loadingContent.getWidth();
		int labelHeight = loadingContent.getHeight();
		
		StaticContent labelBackground = new StaticContent(labelWidth, labelHeight, labelX, labelY);
		labelBackground.getAppearance().add(new PlainBackground(Color.BLUE));
		addWidget(labelBackground);
		
		LanguageLabel label = new LanguageLabel(OptionsWindowText.Changing_Graphic_Settings, GUISource.bigFont);
		label.setXY(labelX, labelY);
		label.setSize(labelWidth, labelHeight);
		GUISource.setTextColor(label, Color.BLACK);
		addWidget(label);
	}
}